/*
 Navicat Premium Data Transfer

 Source Server         : 47.98.49.237
 Source Server Type    : MySQL
 Source Server Version : 50726
 Source Host           : 47.98.49.237:9096
 Source Schema         : db_blog

 Target Server Type    : MySQL
 Target Server Version : 50726
 File Encoding         : 65001

 Date: 17/04/2020 21:57:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_blog
-- ----------------------------
DROP TABLE IF EXISTS `t_blog`;
CREATE TABLE `t_blog` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) DEFAULT NULL,
  `summary` varchar(400) DEFAULT NULL,
  `releaseDate` datetime DEFAULT NULL,
  `clickHit` int(11) DEFAULT NULL,
  `replyHit` int(11) DEFAULT NULL,
  `content` text,
  `typeId` int(11) DEFAULT NULL,
  `keyWord` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `typeId` (`typeId`) USING BTREE,
  CONSTRAINT `t_blog_ibfk_1` FOREIGN KEY (`typeId`) REFERENCES `t_blogtype` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8 COMMENT='博文';

-- ----------------------------
-- Records of t_blog
-- ----------------------------
BEGIN;
INSERT INTO `t_blog` VALUES (42, 'Mysql中文乱码问题解决', '有些学员经常遇到 项目jdbc获取数据库数据，中文乱码；这里给出一些解决方案：第一种，修改Mysql数据库编码，改成utf-8，默认是latin1 （推荐）； 如图，找到mysql安装，点mysql实例配置  一直点next知道下面这个界面：记住，前面那个圈 一点要点。。下拉框选utf8继续next直到：写你', '2016-02-02 13:29:33', 535, 6, '<p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">有些学员经常遇到 项目jdbc获取数据库数据，中文乱码；</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">这里给出一些解决方案：</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><span style=\"color: rgb(255, 0, 0);\">第一种，修改Mysql数据库编码，改成utf-8，默认是latin1 （推荐）；</span></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390480343030776.png\" title=\"\" alt=\"image.png\"/> 如图，找到mysql安装，点mysql实例配置</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390537171022264.jpg\" title=\"\" alt=\"image.jpg\"/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">&nbsp;</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">&nbsp;一直点next知道下面这个界面：</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390616812058607.png\" title=\"\" alt=\"image.png\"/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">记住，前面那个圈 一点要点。。下拉框选utf8</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">继续next直到：</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390692687028654.png\" title=\"\" alt=\"image.png\"/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">写你原来的密码继续，然后继续Next:</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390731515038389.png\" title=\"\" alt=\"image.png\"/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">点击 执行</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><img src=\"/blogImgs/1454390793796097934.png\" title=\"\" alt=\"image.png\"/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">这样就OK了；</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">这个执行完。记得要把原来导入的项目数据库删除，重新的导入下即可；<br/></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><br/><span style=\"color: rgb(255, 0, 0);\"></span></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\"><span style=\"color: rgb(255, 0, 0);\">第二种，修改jdbc请求url 指定编码 （不推荐）<br/></span></p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">在jdbc url后面 加上 ?useUnicode=true&amp;characterEncoding=UTF8 指定下编码；</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">假如是在xml配置文件里 要转义下 搞成 ?useUnicode=true&amp;amp;characterEncoding=UTF-8 ；</p><p style=\"margin: 5px 0px; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">比如在spring配置文件里：</p><pre class=\"brush:xml;toolbar:false\">&lt;!--&nbsp;配置数据源&nbsp;--&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;bean&nbsp;id=&quot;dataSource&quot;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class=&quot;com.alibaba.druid.pool.DruidDataSource&quot;&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property&nbsp;name=&quot;url&quot;&nbsp;value=&quot;jdbc:mysql://localhost:3306/db_blog?useUnicode=true&amp;amp;characterEncoding=UTF-8&quot;/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property&nbsp;name=&quot;username&quot;&nbsp;value=&quot;root&quot;/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;property&nbsp;name=&quot;password&quot;&nbsp;value=&quot;123456&quot;/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;/bean&gt;</pre><p><br/></p><p>推荐第一种；</p><p><br/></p>', 12, 'mysql 乱码');
INSERT INTO `t_blog` VALUES (43, '解决Url带中文参数乱码问题', ' 这里我来介绍下如何配置Tomcat 来解决Url带中文参数乱码问题；首先打开Tomcat安装目录，以Tomcat7为例，其他版本基本一样；打开conf文件打开server.xml大概在70行左右的位置 我们加一个属性 URIEncoding=\"UTF-8\"搞成这样即可。。这个是发布项目的时候，配置方式。下面', '2016-01-22 13:38:39', 587, 5, '<p><img src=\"http://img.baidu.com/hi/jx2/j_0001.gif\"/> 这里我来介绍下如何配置Tomcat 来解决Url带中文参数乱码问题；</p><p><br/></p><p>首先打开Tomcat安装目录，以Tomcat7为例，其他版本基本一样；</p><p><img src=\"/blogImgs/1454391117593077429.jpg\" alt=\"image.jpg\"/></p><p><br/></p><p>打开conf文件</p><p><img src=\"/blogImgs/1454391166890014358.jpg\" alt=\"image.jpg\"/><br/></p><p><br/></p><p>打开server.xml</p><p><img src=\"/blogImgs/1454391299968024532.jpg\" alt=\"image.jpg\"/><br/></p><p><br/></p><p>大概在70行左右的位置 我们加一个属性 URIEncoding=&quot;UTF-8&quot;</p><p><br/></p><p><img src=\"/blogImgs/1454391361171014090.jpg\" alt=\"image.jpg\"/></p><p><br/></p><p>搞成这样即可。。这个是发布项目的时候，配置方式。</p><p><br/></p><p>下面介绍开发的时候，如何配置：</p><p>打开eclipse</p><p>找到server</p><p><img src=\"/blogImgs/1454391411687030232.jpg\" alt=\"image.jpg\"/><br/></p><p><br/></p><p>点开server.xml</p><p><img src=\"/blogImgs/1454391443968032571.jpg\" alt=\"image.jpg\"/><br/></p><p><br/></p><p>和刚才一样，加下 URIEncoding=&quot;UTF-8&quot; 这样就支持Url中文参数了；</p><p><br/></p><p>当然还有其他方法，比较麻烦。比如自己转码，过滤。这里就不介绍了。<br/></p>', 12, 'url中文参数');
INSERT INTO `t_blog` VALUES (61, 'j2se项目如何打成可以运行Jar包', '经常有学员写完一个j2se项目来问我如何打成Jar包，很多学员自己摸索了。由于选错了一个选项，打出来的是Jar包，但不是可运行Jar包；今天我来讲下J2se项目如何打包成可运行Jar包；我们首先建一个J2se项目，随便取名 就叫Test算了：然后我们新建一个Java类 JFrameTest类代码如何：impo', '2016-02-26 21:18:25', 574, 2, '<p>经常有学员写完一个j2se项目来问我如何打成Jar包，很多学员自己摸索了。由于选错了一个选项，打出来的是Jar包，但不是可运行Jar包；<br/></p><p><br/></p><p>今天我来讲下J2se项目如何打包成可运行Jar包；</p><p><br/></p><p>我们首先建一个J2se项目，随便取名 就叫Test算了：</p><p>然后我们新建一个Java类&nbsp;JFrameTest</p><p><img src=\"/blogImgs/1456492304460084475.jpg\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>类代码如何：</p><pre class=\"brush:java;toolbar:false\">import&nbsp;java.awt.Color;\n\nimport&nbsp;javax.swing.JFrame;\n\npublic&nbsp;class&nbsp;JFrameTest&nbsp;{\n\n	public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)&nbsp;{\n		JFrame&nbsp;jFrame=new&nbsp;JFrame(&quot;JFrame窗体&quot;);\n		jFrame.getContentPane().setBackground(Color.RED);&nbsp;//&nbsp;设置容器的背景颜色\n		jFrame.setLocation(400,&nbsp;200);&nbsp;//&nbsp;设置容器的位置\n		jFrame.setSize(500,200);&nbsp;//&nbsp;设置容器大小\n		jFrame.setVisible(true);&nbsp;//&nbsp;让容器显示\n	}\n}</pre><p><br/></p><p>然后我们右击项目，选择 Export(导出)：</p><p><img src=\"/blogImgs/1456492376757021856.png\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>下面就是重点了。一定要选择Runnable Jar file，可以运行Jar包； 选择第一个Jar file就坑了，那个是不可运行的Jar包；</p><p><br/></p><p>我们继续点Next ；</p><p><img src=\"/blogImgs/1456492463241086491.png\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>这里 我们首先选择启动的包含main方法入口的主类，我们开发的j2se项目可能有好几个类里都包含main方法，我们要选入口的类（一般是登录的那个类）；</p><p>我们这里选择JFrameTest； 然后我们再点Browse(浏览)，导出的目标位置，就放桌面算了；</p><p><img src=\"/blogImgs/1456492597600055236.jpg\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>最后我们选择Finish，我们会看到桌面会有一个Jar包；</p><p><img src=\"/blogImgs/1456492651772092576.jpg\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>我们双击运行下，</p><p><img src=\"/blogImgs/1456492676600021293.jpg\" title=\"\" alt=\"image.jpg\"/></p><p><br/></p><p>直接出结果。</p><p><br/></p><p><br/></p><p><br/></p>', 12, '打包');
INSERT INTO `t_blog` VALUES (72, 'Sigar介绍和配置（一）', '介绍Sigar全名是System Information Gatherer And Reporter，中文名是系统信息收集和报表工具。我是一个开源的工具，提供了跨平台的系统信息收集的API ,是Hyperic-hq产品的基础包，是Hyperic HQ主要的数据收集组件。它用来从许多平台收集系统和处理信息。这些', '2017-04-18 09:05:54', 247, 0, '<h1><strong><span style=\"font-family:Microsoft YaHei; font-size:18px\">介绍</span></strong></h1><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Sigar全名是System&nbsp;Information&nbsp;Gatherer&nbsp;And&nbsp;Reporter，中文名是系统信息收集和报表工具。我是一个开源的工具，提供了跨平台的系统信息收集的API&nbsp;,是Hyperic-hq产品的基础包，是Hyperic&nbsp;HQ主要的数据收集组件。它用来从许多平台收集系统和处理信息。</span></p><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">这些平台包括：<a href=\"http://lib.csdn.net/base/linux\" class=\"replace_word\" title=\"Linux知识库\" target=\"_blank\" style=\"color:#df3434; font-weight:bold;\">Linux</a>，Windows，Solaris，AIX，HP-UX，FreeBSD和Mac&nbsp;OSX。</span></p><p><span style=\"font-size:14px\"><strong><span style=\"font-family:Microsoft YaHei\">可以收集的信息</span></strong></span></p><ul class=\" list-paddingleft-2\"><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">CPU信息：包括基本信息（vendor、model、mhz、cacheSize）和统计信息（user、sys、idle、nice、wait）</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">文件系统信息：包括Filesystem、Size、Used、Avail、Use%、Type</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">事件信息：类似Service&nbsp;Control&nbsp;Manager</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">内存信息：物理内存和交换内存的总数、使用数、剩余数；RAM的大小</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">网络信息：包括网络接口信息和网络路由信息</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">进程信息：包括每个进程的内存、CPU占用数、状态、参数、句柄</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">IO信息：包括IO的状态，读写大小等</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">服务状态信息</span></p></li><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">系统信息：包括操作系统版本，系统资源限制情况，系统运行时间以及负载，JAVA的版本信息等</span></p><p><span style=\"font-family:Microsoft YaHei; font-size:14px\"></span></p></li></ul><p><br/></p><h1><strong><span style=\"font-family:Microsoft YaHei; font-size:18px\">地址</span></strong></h1><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Hyperic-hq官方网站：<a target=\"_blank\" href=\"http://www.hyperic.com\"><span style=\"color:#80080\">http://www.hyperic.com</span></a></span></p><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Sigar.jar下载地址：<a target=\"_blank\" href=\"http://sourceforge.net/projects/sigar/files/\"><span style=\"color:#80080\">http://sourceforge.net/projects/sigar/files/</span></a></span></p><h1><strong><span style=\"font-family:Microsoft YaHei; font-size:18px\">使用</span></strong></h1><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Sigar有C，C#，<a href=\"http://lib.csdn.net/base/javase\" class=\"replace_word\" title=\"Java SE知识库\" target=\"_blank\" style=\"color:#df3434; font-weight:bold;\">Java</a>和Perl&nbsp;API，java版的API为sigar.jar。sigar.jar的底层是用<a href=\"http://lib.csdn.net/base/c\" class=\"replace_word\" title=\"C语言知识库\" target=\"_blank\" style=\"color:#df3434; font-weight:bold;\">C语言</a>编写的，它通过本地方法来调用<a href=\"http://lib.csdn.net/base/operatingsystem\" class=\"replace_word\" title=\"操作系统知识库\" target=\"_blank\" style=\"color:#df3434; font-weight:bold;\">操作系统</a>API来获取系统相关数据。</span></p><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Windows操作系统下</span></p><ul style=\"list-style-type: disc;\" class=\" list-paddingleft-2\"><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">Sigar.jar&nbsp;依赖sigar-amd64-winnt.dll<span style=\"font-family: Microsoft YaHei; font-size: 14px; color: rgb(192, 80, 77);\"><strong><span style=\"color:#df3434;font-family: Microsoft YaHei; font-size: 14px;\">(Windows AMD/Intel 64-bit)</span></strong></span>或sigar-x86-winnt.dll<span style=\"color:#df3434;font-family:Microsoft YaHei; font-size:14px\"><strong>(Windows AMD/Intel 32-bit)</strong></span></span></p></li><li><p><span style=\"font-family: Microsoft YaHei; font-size: 14px; color: rgb(0, 0, 0);\">将ddl文件放入jdk安装目标bin目标下。或者通过在代码中执行String str=System.getProperty(&quot;</span>java.library.path&quot;)获取存放路径;<br/></p><p><br/></p></li></ul><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">linux&nbsp;操作系统下</span></p><ul style=\"list-style-type: disc;\" class=\" list-paddingleft-2\"><li><p><span style=\"font-family:Microsoft YaHei; font-size:14px\">则依赖libsigar-amd64-linux.so(<span style=\"font-family:Microsoft YaHei; font-size:14px\"><span style=\"font-family: Microsoft YaHei; font-size: 14px; color: rgb(192, 80, 77);\"><strong><span style=\"color:#df3434;font-family: Microsoft YaHei; font-size: 14px;\">(Linux AMD/Intel 64-bit)</span></strong></span></span>)或libsigar-x86-linux.so<span style=\"font-family:Microsoft YaHei; font-size:14px\"><span style=\"font-family: Microsoft YaHei; font-size: 14px; color: rgb(192, 80, 77);\"><strong><span style=\"color:#df3434;font-family: Microsoft YaHei; font-size: 14px;\">(Linux AMD/Intel 64-bit)</span></strong></span></span></span></p></li><li><p><span style=\"font-family: Microsoft YaHei; font-size: 14px; color: rgb(0, 0, 0);\"><span style=\"font-family: Microsoft YaHei; font-size: 14px;\">将so文件放入/usr/lib64目录下，chomd 744 <span style=\"font-family:Microsoft YaHei; font-size:14px\">libsigar-amd64-linux.so</span>(假设服务器是64位的)<br/></span></span></p></li></ul><p><br/></p>', 4, 'sigar 硬件信息');
INSERT INTO `t_blog` VALUES (73, 'Sigar介绍和配置（二）', '如何在实际项目利用Sigar来获取系统硬件信息？贴一段简单代码：import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import org.hyperic.sigar.Cpu', '2017-04-19 09:04:25', 232, 0, '<p>如何在实际项目利用Sigar来获取系统硬件信息？贴一段简单代码：</p><pre class=\"brush:java;toolbar:false\">import&nbsp;java.util.ArrayList;\nimport&nbsp;java.util.HashMap;\nimport&nbsp;java.util.List;\nimport&nbsp;java.util.Map;\n\nimport&nbsp;org.hyperic.sigar.CpuPerc;\nimport&nbsp;org.hyperic.sigar.FileSystem;\nimport&nbsp;org.hyperic.sigar.FileSystemUsage;\nimport&nbsp;org.hyperic.sigar.Mem;\nimport&nbsp;org.hyperic.sigar.Sigar;\nimport&nbsp;org.hyperic.sigar.Swap;\n\nimport&nbsp;com.alibaba.fastjson.JSON;\nimport&nbsp;com.erpx.tools.util.web.IpUtil;\npublic&nbsp;class&nbsp;SystemMonitor&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Runtime&nbsp;r&nbsp;=&nbsp;Runtime.getRuntime();\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;Sigar&nbsp;sigar&nbsp;=&nbsp;new&nbsp;Sigar();\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;/**\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;获取系统属性\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/\n&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;SystemInfo(Map&lt;String,&nbsp;Object&gt;&nbsp;monitorMap)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(monitorMap&nbsp;==&nbsp;null)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap&nbsp;=&nbsp;new&nbsp;HashMap&lt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;hostIp&quot;,&nbsp;IpUtil.getLocalHostIp());//&nbsp;本地ip地址\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;hostName&quot;,&nbsp;IpUtil.getLocalHostName());//&nbsp;本地主机名\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;osName&quot;,&nbsp;System.getProperty(&quot;os.name&quot;));//&nbsp;操作系统的名称\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;osArch&quot;,&nbsp;System.getProperty(&quot;os.arch&quot;));//&nbsp;操作系统的构架\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;osVersion&quot;,&nbsp;System.getProperty(&quot;os.version&quot;));//&nbsp;操作系统的版本\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;processors&quot;,&nbsp;r.availableProcessors());//&nbsp;JVM可以使用的处理器个数\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;javaVersion&quot;,&nbsp;System.getProperty(&quot;java.version&quot;));//&nbsp;Java的运行环境版本\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;vendor&quot;,&nbsp;System.getProperty(&quot;java.vendor&quot;));//&nbsp;Java的运行环境供应商\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;javaUrl&quot;,&nbsp;System.getProperty(&quot;java.vendor.url&quot;));//&nbsp;Java供应商的URL\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;javaHome&quot;,&nbsp;System.getProperty(&quot;java.home&quot;).replace(&quot;\\\\&quot;,&nbsp;&quot;\\\\\\\\&quot;));//&nbsp;Java的安装路径\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;tmpdir&quot;,&nbsp;System.getProperty(&quot;java.io.tmpdir&quot;).replace(&quot;\\\\&quot;,&nbsp;&quot;\\\\\\\\&quot;));//&nbsp;默认的临时文件路径\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;monitorMap;\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;/**\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;获取内存信息\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;sigar\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/\n&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;memory(Map&lt;String,&nbsp;Object&gt;&nbsp;monitorMap)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(monitorMap&nbsp;==&nbsp;null)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap&nbsp;=&nbsp;new&nbsp;HashMap&lt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;jvmTotal&quot;,&nbsp;Common.div(r.totalMemory(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;M&quot;);//&nbsp;java总内存\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mem&nbsp;mem&nbsp;=&nbsp;sigar.getMem();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;内存总量\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;ramTotal&quot;,&nbsp;Common.div(mem.getTotal(),&nbsp;(1024&nbsp;*&nbsp;1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);//&nbsp;内存总量\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Swap&nbsp;swap&nbsp;=&nbsp;sigar.getSwap();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;交换区总量\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;swapTotal&quot;,&nbsp;Common.div(swap.getTotal(),&nbsp;(1024&nbsp;*&nbsp;1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(Exception&nbsp;e)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;monitorMap;\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;/**\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;获取CPU信息\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;sigar\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/\n&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;cpuInfos()&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;monitorMaps&nbsp;=&nbsp;new&nbsp;ArrayList&lt;Map&lt;String,&nbsp;Object&gt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CpuPerc&nbsp;cpuList[]&nbsp;=&nbsp;sigar.getCpuPercList();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(CpuPerc&nbsp;cpuPerc&nbsp;:&nbsp;cpuList)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;monitorMap&nbsp;=&nbsp;new&nbsp;HashMap&lt;String,&nbsp;Object&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuUserUse&quot;,&nbsp;Math.round(cpuPerc.getUser()*100));//&nbsp;用户使用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuSysUse&quot;,&nbsp;Math.round(cpuPerc.getSys()*100));//&nbsp;系统使用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuWait&quot;,&nbsp;Math.round(cpuPerc.getWait()*100));//&nbsp;当前等待率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuFree&quot;,&nbsp;Math.round(cpuPerc.getIdle()*100));//&nbsp;当前空闲率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuTotal&quot;,Math.round(cpuPerc.getCombined()*100));//&nbsp;总的使用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMaps.add(monitorMap);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(Exception&nbsp;e)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;monitorMaps;\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;/**\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;获取硬盘信息\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;sigar\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/\n&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;diskInfos(){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;monitorMaps&nbsp;=&nbsp;new&nbsp;ArrayList&lt;Map&lt;String,&nbsp;Object&gt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FileSystem&nbsp;fslist[]&nbsp;=&nbsp;sigar.getFileSystemList();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;fslist.length;&nbsp;i++)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;monitorMap&nbsp;=&nbsp;new&nbsp;HashMap&lt;String,&nbsp;Object&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FileSystem&nbsp;fs&nbsp;=&nbsp;fslist[i];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;文件系统类型名，比如本地硬盘、光驱、网络文件系统等\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FileSystemUsage&nbsp;usage&nbsp;=&nbsp;null;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usage&nbsp;=&nbsp;sigar.getFileSystemUsage(fs.getDirName());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;(fs.getType())&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;0:&nbsp;//&nbsp;TYPE_UNKNOWN&nbsp;：未知\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;1:&nbsp;//&nbsp;TYPE_NONE\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;2:&nbsp;//&nbsp;TYPE_LOCAL_DISK&nbsp;:&nbsp;本地硬盘\n\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskName&quot;,&nbsp;fs.getDevName().replace(&quot;\\\\&quot;,&nbsp;&quot;\\\\\\\\&quot;));//&nbsp;系统盘名称\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskType&quot;,&nbsp;fs.getSysTypeName());//&nbsp;盘类型\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;文件系统总大小\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskTotal&quot;,&nbsp;Common.div(usage.getTotal(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;文件系统剩余大小\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskFree&quot;,&nbsp;Common.div(usage.getFree(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;文件系统已经使用量\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskUse&quot;,&nbsp;Common.div(usage.getUsed(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double&nbsp;usePercent&nbsp;=&nbsp;usage.getUsePercent()&nbsp;*&nbsp;100D;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;文件系统资源的利用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;diskUsage&quot;,&nbsp;usePercent);//&nbsp;内存使用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMaps.add(monitorMap);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;3://&nbsp;TYPE_NETWORK&nbsp;：网络\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;4://&nbsp;TYPE_RAM_DISK&nbsp;：闪存\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;5://&nbsp;TYPE_CDROM&nbsp;：光驱\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;6://&nbsp;TYPE_SWAP&nbsp;：页面交换\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(Exception&nbsp;e)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;monitorMaps;\n&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;usage(Map&lt;String,&nbsp;Object&gt;&nbsp;monitorMap)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;JVM使用率\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;jvmUsage&quot;,&nbsp;Math.round(Common.div(r.totalMemory()-r.freeMemory(),&nbsp;r.totalMemory(),&nbsp;2)*100));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;jvm已使用内存\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;jvmUse&quot;,&nbsp;Common.div(r.totalMemory()&nbsp;-&nbsp;r.freeMemory(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;内存使用率\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mem&nbsp;mem&nbsp;=&nbsp;sigar.getMem();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double&nbsp;jvmTotal&nbsp;=&nbsp;Common.div(r.totalMemory(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double&nbsp;oatherTotal&nbsp;=&nbsp;Common.div(mem.getUsed(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)-jvmTotal;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double&nbsp;freeTotal&nbsp;=&nbsp;Common.div(mem.getTotal(),&nbsp;(1024&nbsp;*&nbsp;1024),&nbsp;2)-jvmTotal-oatherTotal;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Object[]&gt;&nbsp;memfoList&nbsp;=&nbsp;new&nbsp;ArrayList&lt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object[]&nbsp;jvmUse&nbsp;=&nbsp;new&nbsp;Object[2];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jvmUse[0]&nbsp;=&nbsp;&nbsp;&quot;JVM&quot;;&nbsp;jvmUse[1]&nbsp;=&nbsp;jvmTotal;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memfoList.add(jvmUse);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object[]&nbsp;otherUse&nbsp;=&nbsp;new&nbsp;Object[2];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;otherUse[0]&nbsp;=&nbsp;&nbsp;&quot;OTHER&quot;;&nbsp;otherUse[1]&nbsp;=&nbsp;oatherTotal;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memfoList.add(otherUse);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object[]&nbsp;memFree&nbsp;=&nbsp;new&nbsp;Object[2];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memFree[0]&nbsp;=&nbsp;&nbsp;&quot;闲置&quot;;&nbsp;memFree[1]&nbsp;=&nbsp;freeTotal;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memfoList.add(memFree);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;ramUsage&quot;,&nbsp;JSON.toJSONString(memfoList));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;ramTotal&quot;,&nbsp;Common.div(mem.getTotal(),&nbsp;(1024&nbsp;*&nbsp;1024&nbsp;*&nbsp;1024),&nbsp;2)&nbsp;+&nbsp;&quot;G&quot;);//&nbsp;内存总量\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;CPU使用率\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;cpus&nbsp;=&nbsp;cpuInfos();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List&lt;Map&lt;String,&nbsp;Object&gt;&gt;&nbsp;cupInfoList&nbsp;=&nbsp;new&nbsp;ArrayList&lt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;m&nbsp;=&nbsp;null,&nbsp;dataMap&nbsp;=&nbsp;null;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;cpus.size();&nbsp;i++)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m&nbsp;=&nbsp;cpus.get(i);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataMap&nbsp;=&nbsp;new&nbsp;HashMap&lt;&gt;();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataMap.put(&quot;name&quot;,&nbsp;&quot;CPU_&quot;+(i+1));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Integer[]&nbsp;data&nbsp;=&nbsp;new&nbsp;Integer[5];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[0]&nbsp;=&nbsp;Integer.parseInt(m.get(&quot;cpuUserUse&quot;).toString());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[1]&nbsp;=&nbsp;Integer.parseInt(m.get(&quot;cpuSysUse&quot;).toString());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[2]&nbsp;=&nbsp;Integer.parseInt(m.get(&quot;cpuWait&quot;).toString());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[3]&nbsp;=&nbsp;Integer.parseInt(m.get(&quot;cpuFree&quot;).toString());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[4]&nbsp;=&nbsp;Integer.parseInt(m.get(&quot;cpuTotal&quot;).toString());\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataMap.put(&quot;data&quot;,data);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cupInfoList.add(dataMap);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitorMap.put(&quot;cpuUsage&quot;,&nbsp;JSON.toJSONString(cupInfoList));//&nbsp;cpu使用率\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(Exception&nbsp;e)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;}\n\n&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;/*public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)&nbsp;throws&nbsp;Exception&nbsp;{\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sigar&nbsp;s&nbsp;=&nbsp;new&nbsp;Sigar();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;?,&nbsp;?&gt;&nbsp;sigar&nbsp;=&nbsp;SystemMemory.usage(s);\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(JSON.toJSONString(sigar));\n\n//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(JSON.toJSONString(SystemInfo.cpuInfos(s)));\n\n//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(JSON.toJSONString(SystemInfo.memory(s)));\n\n//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(JSON.toJSONString(SystemInfo.SystemProperty()));\n\n//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(JSON.toJSONString(new&nbsp;SystemInfo().diskInfos(s)));\n\n&nbsp;&nbsp;&nbsp;&nbsp;}*/\n&nbsp;&nbsp;&nbsp;&nbsp;\n}</pre><p><br/></p>', 4, 'sigar 代码  案例');
INSERT INTO `t_blog` VALUES (74, '解决Eclipse中JSP和JavaScript进行Copy出现卡死 ', '在Eclipse中编辑JSP文件时，对文本字符进行复制和粘贴时，很卡，主要原因是Eclipse中增加了一些JSP和JavaScript的校验，将这些校验去掉基本上就可以了，具体的如下所示：Window\n -> Preference -> General -> Editors -> Text Editors -', '2017-04-24 14:02:50', 247, 0, '<p>在Eclipse中编辑JSP文件时，对文本字符进行复制和粘贴时，很卡，主要原因是Eclipse中增加了一些JSP和<a href=\"http://lib.csdn.net/base/javascript\" class=\"replace_word\" title=\"JavaScript知识库\" target=\"_blank\" style=\"color:#df3434; font-weight:bold;\">JavaScript</a>的校验，将这些校验去掉基本上就可以了，具体的如下所示：</p><p><img src=\"http://img.blog.csdn.net/20140413094117125?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhid3d3/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast\" alt=\"\" style=\"width: 782px; height: 859px;\" width=\"782\" height=\"859\"/><br/></p><p><span style=\"font-family:Tahoma; font-size:14px; line-height:24px\">Window\n -&gt; Preference -&gt; General -&gt; Editors -&gt; Text Editors -&gt; \nHyperLinking -&gt; 在用Ctrl键控制的HyperLinking Style Nevigation列表下, \n取消勾选与JPS或Javascript有关的选项</span><br/></p><p><img src=\"http://img.blog.csdn.net/20140413094051828?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhid3d3/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast\" alt=\"\" style=\"width: 783px; height: 765px;\" width=\"783\" height=\"765\"/></p><p><br/></p>', 5, 'eclipse ');
INSERT INTO `t_blog` VALUES (75, 'MySql生成有唯一ID【Flicker的解决方案】', '因为MySQL本身支持auto_increment操作，很自然地，我们会想到借助这个特性来实现这个功能。Flicker在解决全局ID生成方案里就采用了MySQL自增长ID的机制（auto_increment + replace into + MyISAM）。一个生成64位ID方案具体就是这样的：先创建单独的数', '2017-04-24 15:48:50', 842, 0, '<p>因为MySQL本身支持auto_increment操作，很自然地，我们会想到借助这个特性来实现这个功能。<br/>Flicker在解决全局ID生成方案里就采用了MySQL自增长ID的机制（auto_increment + replace into + MyISAM）。一个生成64位ID方案具体就是这样的：<br/><br/>先创建单独的数据库(eg:ticket)，然后创建一个表：<br/></p><pre class=\"brush:sql;toolbar:false\">CREATE&nbsp;TABLE&nbsp;Tickets64&nbsp;(\nid&nbsp;bigint(20)&nbsp;unsigned&nbsp;NOT&nbsp;NULL&nbsp;auto_increment,\nstub&nbsp;char(1)&nbsp;NOT&nbsp;NULL&nbsp;default&nbsp;&#39;&#39;,\nPRIMARY&nbsp;KEY&nbsp;(id),\nUNIQUE&nbsp;KEY&nbsp;stub&nbsp;(stub)\n)&nbsp;ENGINE=MyISAM</pre><p><br/>在我们的应用端需要做下面这两个操作，在一个事务会话里提交：<br/></p><pre class=\"brush:sql;toolbar:false\">REPLACE&nbsp;INTO&nbsp;Tickets64&nbsp;(stub)&nbsp;VALUES&nbsp;(&#39;a&#39;);\nSELECT&nbsp;LAST_INSERT_ID();</pre><p><br/><span style=\"color: #00ff00;\"><span style=\"line-height: 1.5;\">优</span><span style=\"line-height: 1.5;\">点</span>：</span>充分借助数据库的自增ID机制，提供高可靠性，生成的ID有序。<br/><span style=\"color: #00ff00;\">缺点：</span>占用一个独立的MySQL实例，有些浪费资源，成本较高。</p>', 4, 'mysql  唯一id');
INSERT INTO `t_blog` VALUES (80, '多帐号如何提交同一git托管网站', '这里以在window系统，HJ帐号的情况下，进入C:\\\\Users\\\\HJ\\\\.ssh文件夹下创建config文件(注意没有后缀)。配置config,配置信息参考如下：#Host的名字可以取为唯一的别名（提交的url需要跟着HOST的名称走，比如：git@git1:alphaerp/alpha_erp.git', '2017-05-09 09:00:51', 750, 0, '<ol style=\"list-style-type: decimal;\" class=\" list-paddingleft-2\"><li><p><strong>这里以在window系统，HJ帐号的情况下，进入C:\\\\Users\\\\HJ\\\\.ssh文件夹下</strong></p></li><li><p><strong>创建config文件<span style=\"color: rgb(192, 0, 0); font-size: 14px;\">(注意没有后缀)</span>。</strong></p></li><li><p><strong>配置config,配置信息参考如下：</strong><br/></p></li></ol><pre class=\"brush:xml;toolbar:false\">#Host的名字可以取为唯一的别名（提交的url需要跟着HOST的名称走，比如：git@git1:alphaerp/alpha_erp.git）\n#HostName&nbsp;　　　　　　　&nbsp;&nbsp;&nbsp;这个是真实的域名地址\n#IdentityFile&nbsp;　　　　　　　&nbsp;&nbsp;这里是id_rsa的地址\n#PreferredAuthentications&nbsp;&nbsp;&nbsp;配置登录时用什么权限认证--可设为publickey,password&nbsp;publickey,keyboard-interactive等\n#User&nbsp;　　　　　　　　　　　配置使用用户名\n\n#&nbsp;配置git.oschina.net&nbsp;&nbsp;erp系统\n&nbsp;&nbsp;&nbsp;&nbsp;Host&nbsp;git1\n&nbsp;&nbsp;&nbsp;&nbsp;HostName&nbsp;git.oschina.net\n&nbsp;&nbsp;&nbsp;&nbsp;IdentityFile&nbsp;C:\\\\Users\\\\HJ\\\\.ssh\\\\id_rsa_erp\n&nbsp;&nbsp;&nbsp;&nbsp;PreferredAuthentications&nbsp;publickey\n&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;IT3@alphafashion.cn\n\n#&nbsp;配置git.oschina.net\n&nbsp;&nbsp;&nbsp;&nbsp;Host&nbsp;git.oschina.net&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;HostName&nbsp;git.oschina.net\n&nbsp;&nbsp;&nbsp;&nbsp;IdentityFile&nbsp;C:\\\\Users\\\\HJ\\\\.ssh\\\\id_rsa\n&nbsp;&nbsp;&nbsp;&nbsp;PreferredAuthentications&nbsp;publickey\n&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;1365428@qq.com</pre><p><br/></p>', 12, 'git .ssh 多账号');
INSERT INTO `t_blog` VALUES (82, '通过nginx的image filter图片裁剪组件实现的', 'location ~* /images/(.*)_(\\d+)x(\\d+)(.*)$ {        alias /data/www/static.hejun.vip/images/$1$4;        image_filter crop $2 $3;        image_filter_buffer', '2017-08-03 11:41:56', 648, 0, '<pre class=\"brush:bash;toolbar:false\">location&nbsp;~*&nbsp;/images/(.*)_(\\d+)x(\\d+)(.*)$&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alias&nbsp;/data/www/static.hejun.vip/images/$1$4;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;image_filter&nbsp;crop&nbsp;$2&nbsp;$3;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;image_filter_buffer&nbsp;8M;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires&nbsp;30d;\n}</pre><p><br/></p>', 12, 'nginx 图片裁剪');
COMMIT;

-- ----------------------------
-- Table structure for t_blogger
-- ----------------------------
DROP TABLE IF EXISTS `t_blogger`;
CREATE TABLE `t_blogger` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userName` varchar(50) DEFAULT NULL,
  `password` varchar(100) DEFAULT NULL,
  `profile` text,
  `nickName` varchar(50) DEFAULT NULL,
  `sign` varchar(100) DEFAULT NULL,
  `imageName` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='博主';

-- ----------------------------
-- Records of t_blogger
-- ----------------------------
BEGIN;
INSERT INTO `t_blogger` VALUES (1, 'hejun', '123456', '<p>花名：Frank;</p><p>职业：从事JAVA开发工作8个年头;</p><p>开发语言：Java、Python、Groovy、JavaScript、HTML、Mysql、Sqlserver、Oracle;&nbsp;</p><p>常用技术栈：Linux、Springboot、Redis、nginx、Maven、Docker、Vue、Element、分布式事务Txlcn、Dubbo;</p><p>常用工具：Eclipse、Maven私服、Jenkins私服、阿里云镜像仓库、ECS、ECI、OSS、RDS、阿里集群、负载均衡等;&nbsp;</p><p>目前车况九成新、发动机无暗病、动力充沛、车身线条流畅，整体外观略显厚实。二手库存车辆，停放于广东深圳。商家有意的请打包带走;</p><p>建议&amp;意见反馈：97662463@qq.com<img src=\"http://img.baidu.com/hi/jx2/j_0003.gif\"/>&nbsp; 座右铭: &quot;做人要低调，做事要高调。处人得和气，处事得霸气。&quot; ；</p>', 'Frank', '平平凡凡的生活，踏踏实实的工作', '20170415023406.jpg');
COMMIT;

-- ----------------------------
-- Table structure for t_blogtype
-- ----------------------------
DROP TABLE IF EXISTS `t_blogtype`;
CREATE TABLE `t_blogtype` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `typeName` varchar(30) DEFAULT NULL,
  `orderNo` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='博文类别';

-- ----------------------------
-- Records of t_blogtype
-- ----------------------------
BEGIN;
INSERT INTO `t_blogtype` VALUES (3, '其他', 9);
INSERT INTO `t_blogtype` VALUES (4, '技术', 1);
INSERT INTO `t_blogtype` VALUES (5, '优化', 3);
INSERT INTO `t_blogtype` VALUES (12, '配置', 2);
COMMIT;

-- ----------------------------
-- Table structure for t_comment
-- ----------------------------
DROP TABLE IF EXISTS `t_comment`;
CREATE TABLE `t_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userIp` varchar(50) DEFAULT NULL,
  `blogId` int(11) DEFAULT NULL,
  `content` varchar(1000) DEFAULT NULL,
  `commentDate` datetime DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评论';

-- ----------------------------
-- Table structure for t_link
-- ----------------------------
DROP TABLE IF EXISTS `t_link`;
CREATE TABLE `t_link` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `linkName` varchar(100) DEFAULT NULL,
  `linkUrl` varchar(200) DEFAULT NULL,
  `orderNo` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='友情链接';

-- ----------------------------
-- Records of t_link
-- ----------------------------
BEGIN;
INSERT INTO `t_link` VALUES (1, 'Alpha ERP企业管理系统', 'http://www.alphaerp.net/', 1);
INSERT INTO `t_link` VALUES (3, '小图标下载', 'http://www.easyicon.net/', 3);
INSERT INTO `t_link` VALUES (5, '在线制作免费logo', 'http://www.uugai.com/', 5);
COMMIT;

-- ----------------------------
-- Table structure for t_loglogin
-- ----------------------------
DROP TABLE IF EXISTS `t_loglogin`;
CREATE TABLE `t_loglogin` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `operation` tinyint(3) unsigned DEFAULT NULL COMMENT '用户操作   0：用户登录   1：用户退出',
  `status` tinyint(3) unsigned DEFAULT NULL COMMENT '状态  0：失败    1：成功    2：账号已锁定',
  `agent` varchar(500) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '用户代理',
  `ip` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '操作IP',
  `cname` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '用户名',
  `ctime` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_create_date` (`ctime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='登录日志';

SET FOREIGN_KEY_CHECKS = 1;
